package org.edu;

import lombok.extern.slf4j.Slf4j;
import org.edu.common.util.oConvertUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;

@Slf4j
@EnableScheduling  //通过@EnableScheduling注解开启对计划任务的支持
@EnableFeignClients(basePackages = {"org.edu"})
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = "org.edu")
public class EduStuAppliction {
    public static void main(String[] args) {

        ConfigurableApplicationContext application = SpringApplication.run(EduStuAppliction.class, args);

        Environment env = application.getEnvironment();
        String port = env.getProperty("server.port");
        String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
        log.info("\n----------------------------------------------------------\n\t" +
                "Application edu-Boot is running! Access URLs:\n\t" +
                "Local: \t\thttp://localhost:" + port + path + "/doc.html\n" +
                "----------------------------------------------------------");

    }
}
